import API_PREFIX from './config'

const menuData = [
  {
    id: 'm1',
    order: 1,
    name: '组件示例',
    path: '',
    menu: [
      {
        id: '1',
        path: '',
        meta: {
          title: '表格组件',
          icon: 'table-file',
          cache: false,
        },
        isTopmenu: true,
        children: [
          {
            id: '1',
            path: '/module_sample/table/singleTable',
            meta: {
              title: '单选表格',
              cache: false,
            },
            children: [],
          },
          {
            id: '2',
            path: '/module_sample/table/multipleTable',
            meta: {
              title: '多选表格',
              cache: false,
            },
            children: [],
          },
        ],
      },
      {
        id: '2',
        path: '/module_sample/form/form',
        meta: {
          title: '表单组件',
          cache: true,
          icon: 'list-view',
        },
        isTopmenu: true,
        children: [],
      },
      {
        id: '3',
        path: '/module_sample/tree/tree',
        meta: {
          title: '树形控件',
          cache: true,
          icon: 'tree-list',
        },
        isTopmenu: true,
        children: [],
      },
      {
        id: '4',
        path: '/module_sample/upload/upload',
        meta: {
          title: '附件上传',
          cache: true,
          icon: 'upload-picture',
        },
        isTopmenu: true,
        children: [],
      },
      {
        id: '5',
        path: '/module_sample/modal/modal',
        meta: {
          title: '弹窗扩展',
          cache: true,
          icon: 'browser',
        },
        isTopmenu: true,
        children: [],
      },
      {
        id: '6',
        path: '/module_sample/toast/toast',
        meta: {
          title: '消息提示',
          cache: true,
          icon: 'text-message',
        },
        isTopmenu: true,
        children: [],
      },
      {
        id: '7',
        path: '/module_sample/icon/icon',
        meta: {
          title: '图标',
          cache: true,
          icon: 'text-message',
        },
        isTopmenu: true,
        children: [],
      },
      {
        id: '100',
        path: 'http://www.inweihai.com',
        meta: {
          title: '项目文档',
          cache: true,
          icon: 'link',
        },
        isTopmenu: true,
        children: [],
      },
    ],
  },
  {
    id: 'm2',
    order: 2,
    name: '页面示例',
    path: '',
    menu: [],
  },
]

export default [
  {
    // 获取菜单
    url: `${API_PREFIX}/menu/getAll`,
    method: 'get',
    response: (req) => {
      return {
        errcode: 0,
        errmsg: '操作成功',
        sysErrMsg: null,
        result: menuData,
      }
    },
  },
]
